package com.jerry.base.java8.lambda;

import java.util.function.Consumer;
import java.util.function.Function;

/**
 * 无返回值的函数式接口使用
 *
 * @author Jerry
 * @since 2024/7/31 16:27
 */
public class MethodRef7 {

    public static void main(String[] args) {
        Consumer<Object> c1 = MethodRef7::print1;
        Function<Object, Integer> c2 = MethodRef7::print2;

        Consumer<Object> c3 = MethodRef7::print2;
    }

    static void print1(Object obj) {
        System.out.println(obj);
    }

    static int print2(Object obj) {
        System.out.println(obj);
        return 1;
    }
}
